package com.wang.myblog.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wang.myblog.entity.Article;
import com.wang.myblog.entity.Navbar;
import com.wang.myblog.entity.dto.NavbarDto;
import com.wang.myblog.entity.vo.ArticleVo;
import com.wang.myblog.service.NavbarService;
import com.wang.myblog.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author s
 * @since 2021-05-21
 */
@Api(tags = {"博客面板管理"})
@CrossOrigin
@RestController
@RequestMapping("/myblog/navbar")
public class NavbarController {
    @Autowired
    private NavbarService navbarService;

    @ApiOperation(value = "获取navbar树型数据")
    @PostMapping(value = {"tree"})
    public R tree() {
        //超市id

        List<NavbarDto> treeList = navbarService.treeList();
        return R.ok().data("treeList", treeList);
    }
}

